#ifndef MEDIA__HPP
#define MEDIA__HPP
#include <string>
#include <memory>
#include <sys/stat.h>
#include "File.hpp"
#include <iostream>
#include <unordered_map>
#include <sstream>
#include <algorithm>
#include "File.hpp"
#include "../../Server/include/HTTP.hpp"
#include "../../Server/include/Response.hpp"
#include "../../_debug/include/debug_setting.h"



struct Impl_Media;  // 前向声明

std::shared_ptr<Response> ResponseMedia(HTTP* args);
extern std::unordered_map<std::string,std::string> media_types;

void configurationMediaType();

class _Media{
private:
    friend std::shared_ptr<Response> ResponseMedia(HTTP* args);
    std::shared_ptr<Impl_Media> pimpl;
public:
    _Media();
    _Media(std::string file_path,std::string url);
    void url(std::string url,std::string file_path);
    int is_exist(std::string path,int& file_size);  // 判断多媒体文件是否存在
    std::string get_filePath();
    

};
extern _Media Media;

#endif